"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _jsxRuntime = require("react/jsx-runtime");

var _antdV = require("antd-v4");

var _classnames = _interopRequireDefault(require("classnames"));

var _react = require("react");

var _RouteContext = _interopRequireDefault(require("../../RouteContext"));

require("./GridContent.less");

/**
 * This component can support contentWidth so you don't need to calculate the width
 * contentWidth=Fixed, width will is 1200
 *
 * @param props
 */
var GridContent = function GridContent(props) {
  var value = (0, _react.useContext)(_RouteContext.default);
  var children = props.children,
      propsContentWidth = props.contentWidth,
      propsClassName = props.className,
      style = props.style;

  var _useContext = (0, _react.useContext)(_antdV.ConfigProvider.ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

  var prefixCls = props.prefixCls || getPrefixCls('pro');
  var contentWidth = propsContentWidth || value.contentWidth;
  var className = "".concat(prefixCls, "-grid-content");
  return (0, _jsxRuntime.jsx)("div", {
    className: (0, _classnames.default)(className, propsClassName, {
      wide: contentWidth === 'Fixed'
    }),
    style: style,
    children: (0, _jsxRuntime.jsx)("div", {
      className: "".concat(prefixCls, "-grid-content-children"),
      children: children
    })
  });
};

var _default = GridContent;
exports.default = _default;